<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>山西鸿天汽车服务有限公司</title>
    <link rel="icon" href="common/images/logo.png" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="#">
    <script>
        //判断是否登录
        var user = sessionStorage.getItem("gysuname");
        //未登录则跳到登录页面
        if (!user) {
            location.href = 'login.html';
        }
    </script>
    <!-- load css -->
    <link rel="stylesheet" type="text/css" href="common/layui/css/layui.css" media="all" id="lightThem">
    <link rel="stylesheet" type="text/css" href="css/index.css" media="all" id="index_light">
    <link rel="stylesheet" type="text/css" href="common/global.css" media="all" id="global_light">
    <link rel="stylesheet" type="text/css" href="css/customer_list.css" media="all">
    <style>
        @media screen and (max-width: 1069px) {
        	#myMenu{
                height: 90vh;
        	}
        }

        @media screen and (min-width: 1070px) and (max-width: 1299px){
            #myMenu{
                height: 88vh;
            }
        }

        @media screen and (min-width: 1300px) {
            #myMenu{
                height: 90vh;
            }
        }

        #top_tabs_box {
            margin-top: 0px;
            border-bottom: 10px solid #dce3e6;
        }

        #moreUserId img {
            cursor: pointer;
            transition: all 0.3s;
        }

        #moreUserId img:hover {
            transform: scale(1.2);
        }

        .u-flyer {
            display: block;
            width: 50px;
            height: 50px;
            border-radius: 5000px;
            position: fixed;
            z-index: 9999;
        }

        .hideMenu {
            background: url('./img/icon_menu.png') no-repeat;
        }

        .layui-tab {
            margin: 10px 0 10px;
        }

        .layui-nav-bar {
            display: none;
        }

        /* 主题切换 start 勿动 */
        .sanjiao {
            content: '';
            width: 0;
            height: 0;
            border-style: solid dashed dashed;
            border-color: #fff transparent transparent;
            overflow: hidden;
            cursor: pointer;
            transition: all .2s;
            -webkit-transition: all .2s;
            position: absolute;
            top: 50%;
            right: 3px;
            margin-top: -3px;
            border-width: 6px;
            border-top-color: #fff !important;
        }

        .layui-form-switch {
            background-color: #105a7a;
        }

        .layui-form-switch em {
            color: #fff !important;
        }

        .layui-form-switch i {
            background-color: #fff;
        }

        .layui-form-onswitch {
            border-color: #D2D2D2;
            background-color: #fff;
        }

        .layui-form-onswitch em {
            color: #D2D2D2 !important;
        }

        .layui-form-onswitch i {
            background-color: #D2D2D2;
        }

        /*滚动条的宽度*/
        ::-webkit-scrollbar {
            width: 4px;
        }

        /*滚动条里面小方块*/
        ::-webkit-scrollbar-thumb {
            border-radius: 2px;
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: rgba(0, 0, 0, 0.2);
        }

        /*滚动条里面轨道*/
        ::-webkit-scrollbar-track {
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            border-radius: 0;
            background: rgba(0, 0, 0, 0.1);
        }


        /* 主题切换 end 勿动 */
        body .aux-self{padding: 20px;}
        body .aux-self .layui-input-block{float: left;margin-left: 0;}
        body .aux-self .layui-form-label{width: 90px;}
        .aux-self-word{padding: 8px 10px;float: left; margin-left: 20px; border: 1px solid #e6e6e6;width: 220px;color: #ff1010;
            display: none;}
        .play_audio{
            margin-left: 500px;
            color: #7f7f7f;
        }

        .info_title{
            text-align: center;
            font-size: 26px;
            font-weight:lighter;
            margin: 20px auto;
        }
        .notice_content{
            padding: 10px 30px;
        }
    </style>
</head>

<body class="main_body" id="main_body" onbeforeunload="return delHide()">
<div class="layui-layout layui-layout-admin">
    <!-- 顶部 -->
    <div class="layui-header header" style="background: #fff">
        <div class="layui-main mag0">
            <a href="javascript:;" target="_blank" class="logo" style="padding-left: 10px;">
                <img src="common/images/company.png" style="width: 100px;"/></a>
            <!-- 显示/隐藏菜单 -->
            <a href="javascript:;" class="hideMenu" style="position: absolute; top: 7px; left: 202px;"></a>
            <!--<ul class="layui-nav mobileTopLevelMenus" id="tabFlag" mobile="mobile">
                <li class="layui-nav-item" data-menu="contentManagement" style="display: none">
                    <a href="javascript:;"><i class="seraph icon-caidan"></i><cite>Admin</cite><span
                            class="layui-nav-more"></span></a>
                    <dl class="layui-nav-child">
                        <dd data-menu="1" class="layui-this"><a href="javascript:;"><i class="layui-icon" data-icon=""></i><cite>商品模块</cite></a>
                        </dd>
                        <dd data-menu="3"><a href="javascript:;"><i class="layui-icon"
                                                                    data-icon=""></i><cite>系统模块</cite></a></dd>
                    </dl>
                </li>
                <span class="layui-nav-bar"></span>
            </ul>-->

            <!--<ul class="layui-nav topLevelMenus" pc="pc">
                <li id="logo" onclick="backHome()" style="background: url('./common/images/company.png') no-repeat;cursor:pointer; width: 167px;height: 50px; position: absolute; top: 0;">
                    <img src="common/images/company.png" style="width: 130px;"/>
                </li>
                <li class="hideIcon" id="show1"
                    style="width: 200px;height: 50px; border-bottom: 1px solid #DCE3E6; position: absolute; top: 0; left: -15px;">
                    <img src="common/images/company.png" style="width: 130px;"/>
                </li>
                <span class="layui-nav-bar" style="left: 77.5px; top: 45px; width: 0; opacity: 0;"></span>
            </ul>-->
            <!-- 顶部右侧菜单 -->
            <ul class="layui-nav play_audio">
                <div class="layui-nav-item">
                    <!--<form class="layui-form">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="top:13px;">语音提醒</label>
                            <div class="layui-input-inline audio_item">
                                <input type="checkbox" style="width: 100px;" lay-filter="switchAudio" id="switchAudio" lay-skin="switch" lay-text="已开启|已关闭" />
                            </div>
                        </div>
                    </form>-->
                    <audio src="./file/alarm.mp3" id="myaudio" controls hidden>
                        您的浏览器不支持 audio 标签。
                    </audio>
                </div>
            </ul>
            <div class="layui-nav-item"
                 style=" width: 450px;height: 30px; position: absolute; top: 13px; right: 400px;">
                <a href="https://tianqi.moji.com/forecast7/china/shanxi/yuci-district" target="_blank"
                   style="width: 420px; height: 30px; z-index: 10; position: absolute; top: -2px; left: -22px;"></a>
                <a href="javascript:void(0)">
                    <iframe width="auto" scrolling="no" height="30" frameborder="0" allowtransparency="true"
                            style="color: #999"
                            src="//i.tianqi.com/index.php?c=code&id=1&color=%23808080&icon=1&py=yuci&wind=1&num=1&site=15"></iframe>
                </a>
            </div>
            <ul class="layui-nav top_menu">
                <!-- 主题切换 -->
                <form class="layui-form" style="float: right; position: relative; top: -6px; right: 294px;">
                    <input type="checkbox" lay-filter="switchThem" id="switchThem" lay-skin="switch" lay-text="浅色|深色"
                           value="1"/>
                </form>
                <!-- 全屏按钮 -->
                <li class="layui-nav-item" style="position: relative;">
                    <a href="#" data-toggle="fullscreen" >
                        <i class="layui-icon layui-icon-screen-full" style="color: #0D475B;font-size: 20px;"></i>
                    </a>
                </li>

                <li class="layui-nav-item" id="userInfo" style="position: relative; top: 0; right: -78px;">
                    <a href="javascript:;" style="margin-right: -4px">
                        <!--                        <cite>Admin</cite>-->
                        <!--<img class="layui-nav-img userAvatar" width="35" height="35" src="./管理后台_files/face.jpg">-->
                        <span class="adminName" id="adminName" style="color: #0F5163; font-weight: 700"></span>
                        <span class="layui-nav-more" style="border-top-color:#333;right: 0;"></span>
                    </a>
                    <!--<dl class="layui-nav-child layui-anim layui-anim-upbit">
                        <dd><a href="javascript:;" data-url="page/user/userInfo.html"><i class="seraph icon-ziliao" data-icon="icon-ziliao"></i><cite>个人资料</cite></a></dd>
                        <dd><a href="javascript:;" data-url="page/user/changePwd.html"><i class="seraph icon-xiugai" data-icon="icon-xiugai"></i><cite>修改密码</cite></a></dd>
                        <dd><a href="javascript:;" class="showNotice"><i class="layui-icon">&#xe645;</i><cite>系统公告</cite><span class="layui-badge-dot"></span></a></dd>
                        <dd pc="pc"><a href="javascript:;" class="functionSetting"><i class="layui-icon">&#xe620;</i><cite>功能设定</cite><span class="layui-badge-dot"></span></a></dd>
                        <dd pc="pc"><a href="javascript:;" class="changeSkin"><i class="layui-icon">&#xe61b;</i><cite>更换皮肤</cite></a></dd>
                        <dd><a href="waterlogin.html" class="signOut"><i class="seraph icon-tuichu"></i><cite>退出</cite></a></dd>
                    </dl>-->

                    <dl class="layui-nav-child layui-anim layui-anim-upbit">
                        <dd>
                            <a class="resetPwd" style="text-align: center"><i
                                    class="seraph icon-tuichu"></i><cite>修改密码</cite></a>
                            <a href="login.html" class="signOut" style="text-align: center"><i
                                    class="seraph icon-tuichu"></i><cite>退出</cite></a>
                        </dd>
                    </dl>
                </li>
            </ul>
            <span class="layui-nav-bar" style="left: 137px; top: 45px; width: 0px; opacity: 0;"></span>
        </div>
    </div>
    <!-- 左侧导航 -->
    <div class="layui-side" id="leftBG" style="background: #105A7A">
        <div class="navBar layui-side-scroll" id="navBar" style="height: 701px;">
            <ul id="myMenu" class="layui-nav layui-nav-tree" style="overflow: auto;">
                <li class="layui-nav-item" onclick="clickStyle()" onmousemove="moveStyle()" onmouseout="outStyle()" id="">
                    <a href="javascript:;" data-url="./html/inquiry/index.html">
                        <i class="layui-icon">&#xe63c;</i>
                        <cite class="citeLight">询价单列表</cite>
                    </a>
                </li>
                <li class="layui-nav-item" onclick="clickStyle()" onmousemove="moveStyle()" onmouseout="outStyle()" id="">
                    <a href="javascript:;" data-url="./html/sales/index.html">
                        <i class="layui-icon">&#xe663;</i>
                        <cite class="citeLight">供货单管理</cite>
                    </a>
                </li>
                <li class="layui-nav-item" onclick="clickStyle()" onmousemove="moveStyle()" onmouseout="outStyle()" id="">
                    <a href="javascript:;" data-url="./html/financial/index.html">
                        <i class="layui-icon">&#xe663;</i>
                        <cite class="citeLight">财务管理</cite>
                    </a>
                </li>
                <li class="layui-nav-item" onclick="clickStyle()" onmousemove="moveStyle()" onmouseout="outStyle()" id="">
                    <a href="javascript:;" data-url="./html/system/user.html">
                        <i class="layui-icon">&#xe66f;</i>
                        <cite class="citeLight">个人中心</cite>
                    </a>
                </li>
                <li class="layui-nav-item" onclick="clickStyle()" onmousemove="moveStyle()" onmouseout="outStyle()" id="">
                    <a href="javascript:;" data-url="./html/system/notice.html">
                        <i class="layui-icon">&#xe667;</i>
                        <cite class="citeLight">公告历史</cite>
                    </a>
                </li>
                <li class="layui-nav-item" style="display: none">
                    <a href="javascript:void(0);">
                        <cite>隐藏菜单</cite>
                        <em class="layui-nav-more"></em>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;" data-url="./html/inquiry/detail.html">
                                <cite>报价详情</cite>
                            </a>
                        </dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;" data-url="./html/inquiry/quote.html">
                                <cite>询价详情</cite>
                            </a>
                        </dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;" data-url="./html/sales/detail.html">
                                <cite>供货详情</cite>
                            </a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <!-- 右侧内容 -->
    <div class="layui-body layui-form" id="rightBot" style="border-top: 2px solid #DCE3E6;">
        <div class="layui-tab mag0" lay-filter="bodyTab" id="top_tabs_box">
            <ul class="layui-tab-title top_tab" lay-filter="top_tabs" id="top_tabs">
                <li class="layui-this" id="indexMain" lay-id=""><i class="layui-icon"></i> <cite>首页</cite></li>
            </ul>
            <div class="layui-nav"
            style=" float: right;margin-top: 10px;right: -9%;"><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">ဂ</i>  刷新当前</a></div>

            <ul><span class="layui-nav-bar" style="left: 48px; top: 35px; width: 0px; opacity: 0;"></span></ul>
            <div class="layui-tab-content clildFrame">
                <div class="layui-tab-item layui-show">
                    <iframe id="iframeID" src="./indexShow.html"></iframe>
                </div>
            </div>
        </div>
    </div>


    <!-- 底部 -->
    <div class="layui-footer footer" style="left: 0">
        <p>
            <span>Copyright </span>
            <span id="everYears">©2024 </span>
            <span>鸿天科技 </span>
            <span>晋ICP备17005539号-4</span>
        </p>
    </div>
</div>

<!-- 移动导航 -->
<div class="site-tree-mobile"><i class="layui-icon"></i></div>
<div class="site-mobile-shade"></div>
<!--修改密码-->
<div class="modify-pwd-layer aux-self" id="modifypwdlayer" style="display: none">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">原密码</label>
            <div class="layui-input-block">
                <input id="mopwd" type="password" name="oldPsw" required  lay-verify="required" autofocus placeholder="请输入原密码" autocomplete="off" class="layui-input">
            </div>
            <div id="mopwd-aux" class="aux-self-word"></div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input id="newpwd1" type="password" name="newPsw" required  lay-verify="required|npsw" placeholder="请输入新密码" autocomplete="off" class="layui-input">
            </div>
            <div id="newpwd1-aux" class="aux-self-word"></div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">再次输入</label>
            <div class="layui-input-block">
                <input id="newpwd2" type="password" name="rePsw" required  lay-verify="required|repsw" placeholder="请再次输入新密码" autocomplete="off" class="layui-input">
            </div>
            <div id="newpwd2-aux" class="aux-self-word"></div>
        </div>
    </form>
</div>
<script>

</script>
<script type="text/html" id="showNoticeForm">
    <div class="layui-card-body" id="notice" style="align-items: center;text-align: center">
        <h3 class="info_title" id="notice_title">{{d.notice_title}}</h3>
        <p class="notice_content" id="content">{{d.content}}</p>
    </div>
</script>
<script type="text/javascript" src="./js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="./js/jquery.cookie.js"></script>
<script type="text/javascript" src="./common/layui/layui.js"></script>
<script type="text/javascript" src="./common/bodyTab.js"></script>
<script type="text/javascript" src="./js/index.js"></script>
<script type="text/javascript" src="./js/jquery.fly.min.js"></script>
<script type="text/javascript" src="./common/cache.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<script>
    //判断是否登录
    var user = sessionStorage.getItem("gysuname");
    var go_to_page_general;
    var open_pic_url;
    var userInfo = JSON.parse(getSessionStorage('gysuname'));
    let userHasInteracted = false;
    let aduioShow = true;
    $(function () {
        // 检测任何用户交互事件
        window.addEventListener('click', () => {
            userHasInteracted = true;
        });
        $("#everYears").val(new Date().dateFormat('yyyy'));
        if ('light' == $.cookie('them')) {
            // 亮色主题
            $.removeCookie('them');
            $.cookie('them', 'light');
            $("#switchThem").attr("checked", "");

            document.getElementById("lightThem").setAttribute("href", "common/layui/css/layui_light.css");
            document.getElementById("index_light").setAttribute("href", "css/index_light.css");
            document.getElementById("global_light").setAttribute("href", "common/global_light.css");
            // 左侧导航背景色
            $("#leftBG").addClass("bgColorLight");
            $("#navBar")[0].style.borderTop = "1px solid #DCE3E6";
            $("#rightBot")[0].style.borderTop = "1px solid #DCE3E6";
            $("#rightBot")[0].style.borderLeft = "2px solid #DCE3E6";

        } else {
            // 深色主题
            $.removeCookie('them');
            $.cookie('them', 'dark');

            document.getElementById("lightThem").setAttribute("href", "common/layui/css/layui.css");
            document.getElementById("index_light").setAttribute("href", "css/index.css");
            document.getElementById("global_light").setAttribute("href", "common/global.css");

            // 左侧导航背景色
            $("#leftBG").removeClass("bgColorLight");
            $("#navBar")[0].style.borderTop = "0";
            $("#rightBot")[0].style.borderTop = "2px solid #DCE3E6";
            $("#rightBot")[0].style.borderLeft = "2px solid #fff";
        }

        // 适配移动端样式
        if (!isPC()) {
            $("#adminName")[0].style.marginRight = '8px';
        }
    });

    function backHome() {
        if (!isPC()) {
            initPhone();
        }
        $("a[data-url='./index.html']").click();
        $("iframe[src='./index.html']").attr('src', './index.html');
    }

    // 导航栏鼠标移入
    function moveStyle(idx) {
        if ('light' == $.cookie('them')) {
            if ('layui-nav-item' == $("#n_" + idx).attr("class")) {
                $("#on_" + idx).addClass("sanjiao");
            }
        }
    };

    // 导航栏鼠标移出
    function outStyle(idx) {
        if ('light' == $.cookie('them')) {
            $("#on_" + idx).removeClass('sanjiao');
        }
    };

    // 导航栏点击
    function clickStyle(idx) {
        if ('light' == $.cookie('them') && 'layui-nav-item layui-nav-itemed' == $("#n_" + idx).attr("class")) {
            $("#on_" + idx).removeClass('sanjiao');
            // 其他标签恢复正常样式
            let count = $("#myMenu li").length;
        }
    };

    function initPhone() {
        $("#main_body")[0].style.minWidth = '0';
    }

    function initPhone2() {
        $("#main_body")[0].style.minWidth = '1100px';
    }

    layui.use(['jquery', 'layer', 'element', 'form'], function () {
        window.jQuery = window.$ = layui.jquery;
        element = layui.element;
        var form = layui.form;

        form.render('checkbox'); // 重新渲染表单项以应用新的状态

        //全屏事件 --star
        $(document).on('click', "[data-toggle='fullscreen']", function () {
            var doc = document.documentElement;
            if ($(document.body).hasClass("full-screen")) {
                $(document.body).removeClass("full-screen");
                document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen();
            } else {
                $(document.body).addClass("full-screen");
                doc.requestFullscreen ? doc.requestFullscreen() : doc.mozRequestFullScreen ? doc.mozRequestFullScreen() : doc.webkitRequestFullscreen ? doc.webkitRequestFullscreen() : doc.msRequestFullscreen && doc.msRequestFullscreen();
            }
        });

        $(".adminName").text(userInfo.suppliers_company_name);

        go_to_page_general = function (urlStr,paramStr='') {
            $("a[data-url*='" + urlStr + "']").click();
            if(paramStr){
                $("iframe[src*='" + urlStr + "']").attr('src', urlStr+'?'+paramStr);
            }else{
                $("iframe[src*='" + urlStr + "']").attr('src', urlStr);
            }
        }

        window.replaceIframe = function(urlStr,paramStr) {
            $('.layui-tab-title .layui-this i.layui-tab-close').click();
            $("a[data-url*='" + urlStr + "']").click();
            $("iframe[src*='" + urlStr + "']").attr('src', urlStr+'?'+paramStr);
        };

        open_pic_url = function open_pic_url(url){
            layer.photos({
                photos: {
                    "data": [{
                        "alt": '',
                        "pid": 1, // 不同的图片 pid 可以不一样
                        "src": url,
                    }]
                },
                anim: 5 // 0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用的是shift参数）
            });
            return false;
        }
        $('.resetPwd').click(function () {
            showModifyLayer()
        });
        function showModifyLayer() {
            let index = layer.open({
                type: 1,
                btn: ['取消','确定'],
                title: "修改密码",
                area: ["660px", "320px"],
                content: $("#modifypwdlayer"),
                //++enter
                success: function(layero, index){
                    getModifyPwd();
                },
                cancel: function(index, layero){
                    $("#mopwd").val("")
                    $("#mopwd-aux").css("display", "none")
                    $("#newpwd1").val("")
                    $("#newpwd1-aux").css("display", "none")
                    $("#newpwd2").val("")
                    $("#newpwd2-aux").css("display", "none")
                },
                yes: function (index) {
                    layer.close(index);
                },btn2: function (index) {
                    confirmModifyPwd(index)
                    return false
                }
            });
        }

        function getModifyPwd() {
            var pwd = userInfo.password;
            $("#mopwd").blur(function () {
                let mopwd = $("#mopwd").val().trim();
                if (mopwd.length == 0) {
                    $("#mopwd-aux").css({
                        display: "block",
                        color: "#ff1010",
                    }).html("请输入原密码")
                } else {
                    //发送ajax获得原密码 pwd
                    send_req('User/getMd5Str.html', {words: mopwd}, function (data) {
                        console.log(data)
                        console.log(pwd)
                        if (data != pwd) {
                            $("#mopwd-aux").css({
                                display: "block",
                                color: "#ff1010",
                            }).html("密码不正确")
                        } else {
                            $("#mopwd-aux").css({
                                display: "block",
                                color: "#5FB878"
                            }).html("输入正确")
                        }
                    });
                }
            })

            var newpwd1 = $("#newpwd1").val().trim()
            let pwdPattern =/^[\S]{5,20}$/;

            $("#newpwd1").blur( function () {
                newpwd1 = $("#newpwd1").val().trim()
                if (newpwd1.length == 0) {
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("请输入新密码")
                } else if(!pwdPattern.test(newpwd1)){
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("密码必须5到20位，且不能出现空格")
                }else {
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#5FB878"
                    }).html("输入正确")
                }
            })

            $("#newpwd2").focus(()=> {
                let newpwd1 = $("#newpwd1").val().trim()
                if (newpwd1.length == 0) {
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("请输入新密码")
                }
            })

            $("#newpwd2").blur( function () {
                let newpwd2 = $("#newpwd2").val().trim()
                let mopwd = $("#mopwd").val().trim();
                if (newpwd2.length == 0) {
                    $("#newpwd2-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("请输入新密码")
                } else if (newpwd1 != newpwd2) {
                    $("#newpwd2-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("两次输入不一致")
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("两次输入不一致")

                } else if (newpwd1 == newpwd2 && newpwd1 == mopwd) {
                    $("#newpwd2-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("新密码不能与原密码相同")
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#ff1010"
                    }).html("新密码不能与原密码相同")
                } else {
                    $("#newpwd1-aux").css({
                        display: "block",
                        color: "#5FB878"
                    }).html("输入正确")
                    $("#newpwd2-aux").css({
                        display: "block",
                        color: "#5FB878"
                    }).html("输入正确")
                    $("div").data("new_pwd", newpwd1)
                    $("div").data("old_pwd", mopwd)
                }
            });
        }
        function confirmModifyPwd(index) {
            let newpwd = $("div").data("new_pwd");
            let oldPsw = $("div").data("old_pwd");
            $("#mopwd").val('')
            $("#mopwd-aux").css("display", "none")
            $("#newpwd1").val("")
            $("#newpwd1-aux").css("display", "none")
            $("#newpwd2").val("")
            $("#newpwd2-aux").css("display", "none")
            //发送ajax
            send_req('User/update_password', {
                id:userInfo.id,
                newPsw:newpwd,
                oldPsw:oldPsw,
            }, function (res) {
                layer.closeAll('loading');
                layer.closeAll('page');
                var t=parseInt(3);
                layer.close(index);
                window.setInterval(function () {
                    if(t>0){
                        var msg = "修改成功，将在"+t+"秒后返回登录界面，请重新登录！";
                        layer.msg(msg);
                    }else{
                        var path = "https://desheng.hot68.cn/htqipei/gypage/login.html"
                        top.location.href=path;
                    }
                    t--;
                },1000);
            },false);
        }
        form.on('switch(switchThem)', function (data) {
            let checked = data.elem.checked;
            if (checked) {
                // 亮色主题
                $.removeCookie('them');
                $.cookie('them', 'light');
                window.location.reload();
            } else {
                // 深色主题
                $.removeCookie('them');
                $.cookie('them', 'dark');
                window.location.reload();
            }
            form.render('checkbox');
        });

        form.on('switch(switchAudio)', function (data) {
            let checked = data.elem.checked;
            if (checked) {
                // 亮色主题
                aduioShow = true;
            } else {
                aduioShow = false;
            }
            form.render('checkbox'); // 重新渲染表单项以应用新的状态
        });

    });
    const myAudio = document.getElementById('myaudio');
    setInterval(function () {
        var  t = new Date().getTime();
        // console.log(t)
        send_req('Order/getNewInfo', {'times':t}, function (data) {
            /*if(aduioShow){
                playAudio();
            }*/
            if (data && parseInt(data) > 0) {
                // 如果结果大于0，则播放音频
                playAudio();
            }
        });
    },60000)

    // 定义播放音频的函数
    function playAudio() {
        if (userHasInteracted) {
            // 确保音频已加载并且可以播放
            if (myAudio.readyState >= 2) { // HAVE_CURRENT_DATA or more
                myAudio.currentTime = 0; // 重置播放位置到开头
                myAudio.play()
                    .then(() => {
                        console.log("音频开始播放");
                    })
                    .catch((error) => {
                        console.error("音频播放失败:", error);
                    });
            } else {
                console.warn("音频资源尚未准备好");
            }
        }else{
            alert('请先点击页面进行交互，接收语音提醒！')
        }
    }

    var currentNoticeLayerIndices = []; // 用于存储所有当前打开的通知弹框的索引

    setInterval(function () {
        send_req('Common/getUserNoticeMore', {}, function (data) {
            if(data.count > 0){
                // 对于每条通知数据，调用showNoticePopup函数来显示弹框
                data.data_list.forEach(function(notice) {
                    showNoticePopup(notice);
                });
            }
        });
    }, 60000);

    function showNoticePopup(data) {
        // 动态计算offset以避免弹框重叠
        var offsetTop = 65 + (currentNoticeLayerIndices.length * 20); // 假设每个弹框高度为600px，间距为20px

        // 打开新弹框并获取其索引
        var noticeLayerIndex = layer.open({
            type: 1,
            area: ['800px','600px'],
            offset: offsetTop + 'px',
            title: '通知公告',
            content: $('#showNoticeForm').html(),
            success: function (layero, index) {
                // 将当前弹框的索引添加到数组中
                currentNoticeLayerIndices.push(index);

                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                // 使用当前弹框上下文查找元素
                $('#notice_title', layero).html(data.notice_title);
                $('#content', layero).html(data.content);
                if(data.pic_urls && data.pic_urls.length > 0){
                    for (var i = 0; i < data.pic_urls.length; i++) {
                        $('#notice', layero).append(
                            '<div class="file-iteme">' +
                            '<div class="handle" id='+i+'></div>' +
                            '<img class="imgs" style="width: 400px;height: auto;" src=' + data.pic_urls[i] + '>' +
                            '<div class="info"></div>' +
                            '</div>'
                        );
                    }
                }
            },
            end: function(){ // 监听关闭事件
                // 当弹框关闭时，从数组中移除对应的索引
                var indexToRemove = currentNoticeLayerIndices.indexOf(noticeLayerIndex);
                if(indexToRemove !== -1) {
                    currentNoticeLayerIndices.splice(indexToRemove, 1);
                }
            }
        });
    }

    /*setInterval(function () {
        send_req('Common/getUserNotice', {}, function (data) {
            if(data && !data.user_state){
                layer.open({
                    type: 1,
                    area: ['800px','600px'],
                    offset: '65px',
                    title: '通知公告',
                    content: $('#showNoticeForm').html(),
                    success: function (layero, index) {
                        $(layero).children('.layui-layer-content').css('overflow', 'visible');
                        $('#notice_title').html(data.notice_title);
                        $('#content').html(data.content);
                        if(data.pic_urls.length>0){
                            for (var i=0; i<data.pic_urls.length;i++){
                                $('#notice').append( '<div class="file-iteme">' +
                                    '<div class="handle" id='+i+'></div>' +
                                    '<img class="imgs" style="width: 400px;height: auto;" src='+ data.pic_urls[i] +'>' +
                                    '<div class="info"></div>' +
                                    '</div>');
                            }
                        }
                    },
                    end: function(){ // 监听关闭事件

                    }
                })
            }
        });
    },60000)*/

    setInterval(function () {
        var  t = sessionStorage.getItem("logintime");
        if(!t)return;
        if((new Date().getTime()-t)>1000*60*60*20){
            sessionStorage.clear();
            location.href = "login.html";
        }
    },60000)

</script>
</body>
</html>